home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NetNews Offline 2
/
NetNews Offline Volume 2.iso
/
news
/
comp
/
std
/
c
/
758
< prev
next >
Wrap
Internet Message Format
|
1996-08-06
|
3KB
Path: solon.com!not-for-mail
From: seebs@solutions.solon.com (Peter Seebach)
Newsgroups: comp.std.c,comp.lang.c.moderated
Subject: Re: printf() format extensions - looking for beta testers...
Date: 17 Apr 1996 15:32:04 -0500
Organization: Usenet Fact Police (Undercover)
Approved: seebs
Message-ID: <4l3kg4$avi@solutions.solon.com>
References: <4koecq$8up@solutions.solon.com> <4kr74a$k8o@solutions.solon.com> <4ksk72$rm6@solutions.solon.com> <4l33qn$7rv@solutions.solon.com>
Reply-To: seebs@solon.com
NNTP-Posting-Host: solutions.solon.com
In article <4l33qn$7rv@solutions.solon.com>,
Sean 'Captain Napalm' Conner <spc@gate.net> wrote:
>In article <4ksk72$rm6@solutions.solon.com> seebs@solon.com writes:
> >In article <4kr74a$k8o@solutions.solon.com>,
> >Whatever you want; it's just that if you change %#, you change the behavior
> >of existing legal programs.
> Existing legal programs using your printf()?
No... I mean that, if this extension or change were adopted, the goal is that
all currently defined programs continue to be defined to do the same thing,
and the changes will affect only code using new features.
Given that, though, if (using this extension) you were to change the behavior
of the # character in a printf format, previously written code would change in
behavior. This is a feature, sort of, but is one to be wary of.
> Again, existing code you wrote? Gee, just like make requiring tabs (and
>only tabs). Can't fix it, because too many make files would "break" (sorry,
>my anti-Unix bias is showing 8-)
I'm not sure how a makefile using tabs would break on a make allowing
tabs-or-spaces, but that's atopical; feel free to email me with an example.
No, I mean existing code *anyone* wrote; the goal is to change the behavior of
no existing program, and make it possible for people to use the new features
as consistently as possible.
> But you still have the problem of overloading (what if I wanted to use %<
>for something?).
Then you'd change it. My current design allows you to make %d always print a
1. You are not required to use the standard set of flags. (This is a quality
of programmer issue.) The idea would be to offer some new format flags,
and then also provide a generic way to add new ones, or replace old ones.
I'm hoping to get this or a similar proposal added, because it would make my
lifie immensely easier. I'm still looking at similar proposals. I have
decided that I'm probably going to have to choose a different way to pass data
around, though.
-s
--
Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
C/Unix wizard -- C/Unix questions? Send mail for help. No, really!
Unsolicited email is not welcome, and will be billed for at consulting rates.
The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html